package expressoes;

import java.util.HashMap;

public class Implica extends Binaria {

	public Implica(Expressao a, Expressao b) {
		exp1 = a;
		exp2 = b;
		operador = "->";
	}

	@Override
	public String calcula(HashMap<String, String> hash) {
		
		String r = "";
		
//		if(!hash.containsKey(exp1.getExpressao())){
//			r = exp1.calcula(hash);
//		} else {
//			r = hash.get(exp1.getExpressao());
//		}
		
//		if(r.equals("0")){
//			if(!hash.containsKey(exp1.getExpressao())){
//				r = exp1.calcula(hash);
//			} else {
//				r = hash.get(exp1.getExpressao());
//			}
//		}
		
		Or or = new Or(new Not(exp1), exp2);
		
		r = or.calcula(hash);
		
		return r;

	}

}
